<%@ Register TagPrefix="dammela" Namespace="whole" Assembly = "dammela" %>
<%@ Page validateRequest="false" Language="C#" Description="Homepage" Culture="it-IT" trace="false" debug="false" EnableViewState="false"%>

<html>
<head>


<LINK type="text/css" rel="stylesheet" href="/main.css">
<meta http-equiv="Content-Type" Content="text/html; charset=ISO-8859-1">
<script src="http://maps.google.com/maps?file=api&v=2&key=<%Response.Write( ConfigurationSettings.AppSettings["gmaps."+ ConfigurationSettings.AppSettings["system"] +"."+Request.Url.Host ] );%>" type="text/javascript"></script>
<script language="JavaScript" src="/jscripts/ajax.venues.js"></script>
<title id="title" runat=server></title>
</head>

<script>
function PageQuery(q) {
	if(q.length > 1) this.q = q.substring(1, q.length);
	else this.q = null;
	this.keyValuePairs = new Array();
	if(q) {
		for(var i=0; i < this.q.split("&").length; i++) {
			this.keyValuePairs[i] = this.q.split("&")[i];
		}
	}
	this.getKeyValuePairs = function() { return this.keyValuePairs; }
	this.getValue = function(s) {
		for(var j=0; j < this.keyValuePairs.length; j++) {
			if(this.keyValuePairs[j].split("=")[0] == s)
			return this.keyValuePairs[j].split("=")[1];
		}
		return false;
	}
	this.getParameters = function() {
		var a = new Array(this.getLength());
		for(var j=0; j < this.keyValuePairs.length; j++) {
			a[j] = this.keyValuePairs[j].split("=")[0];
		}
		return a;
	}
	this.getLength = function() { return this.keyValuePairs.length; }
}
function queryString(key){
	var page = new PageQuery(window.location.search);
	return unescape(page.getValue(key));
}

function displayItem(key){
if(queryString(key)=='false')
{
document.write("you didn't enter a ?name=value querystring item.");
}else{
document.write(queryString(key));
}
}
</script>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<div id="info">
	<div class="galleryTitle"><nobr><script>displayItem("name");</script></nobr></div>
	<div class="body"><nobr><script>displayItem("address");</script>, <script>displayItem("nr");</script></nobr></div>
	<div class="body"><nobr><script>displayItem("zip");</script> - <script>displayItem("city");</script> (<script>displayItem("country");</script>)</nobr></div>
</div>

<div id="map" style="width: 100%; height: 100%;"></div>
<script type="text/javascript">
//<![CDATA[

var lon = queryString('longitude');
var lat = queryString('latitude');

var map = new GMap(document.getElementById("map"));
//map.addControl(new GSmallMapControl());
map.addControl(new GLargeMapControl());
map.addControl(new GScaleControl()); 
map.addControl(new GMapTypeControl());
map.centerAndZoom(new GPoint(lon, lat), 1);
//map.setMapType(map.mapTypes[2]);
if(queryString("type")=='NORMAL')
{
map.setMapType( G_NORMAL_MAP );
}else{
map.setMapType( G_SATELLITE_MAP );
}

var point = new GPoint(lon, lat);
var marker = new GMarker(point);
map.addOverlay(marker);

map.openInfoWindow(new GPoint(lon, lat),document.getElementById("info"));

//]]>
</script>

</body>
</html>